package com.teach;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-13 15:59
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class ObjectTest {

  public static void main(String[] args) {
    Student s1 = new Student("张三");
    Student s2 = new Student("张三");
    Student s3 = s1;
    System.out.println(s1==s2);//false
    System.out.println(s1==s3);//true
    System.out.println(s1.equals(s2));//true? false ?? >> Object return (this == obj);

    String str1 = "abc";
    String str2 = new String(str1);
    System.out.println(str1.equals(str2));//true

    Student1 s11 = new Student1("张三");
    Student1 s12 = new Student1("张三");
    System.out.println(s11==s12);//false
    System.out.println(s11.equals(s12));// >> true 重写equals

    System.out.println(s1);
    System.out.println(s2);
    System.out.println(s11);
    System.out.println(s12);



  }

}
